package com.hckj.jianzhijia.controllers;

import android.content.Context;
import android.graphics.drawable.Drawable;

import com.hckj.jianzhijia.R;
import com.hckj.jianzhijia.utils.StateConstant;

/**
 * Created by 赵奇隆 on 2015-10-31.
 */
public class JobListController {


    private Context context;


    public JobListController(Context context) {
        this.context = context;
    }

    public Drawable getImageResourceDrawable(int jobType){

        Drawable drawable = null;

        switch (jobType){
            case StateConstant.JOB_FAMILY_TEACHER:
                drawable = context.getResources().getDrawable(R.drawable.ic_jiajiao);
                break;
            case StateConstant.JOB_SELL:
                drawable = context.getResources().getDrawable(R.drawable.ic_xiaoshou);
                break;
            case StateConstant.JOB_WAITER:
                drawable = context.getResources().getDrawable(R.drawable.ic_fuwuyuan);
                break;
            case StateConstant.JOB_SCHOOL:
                drawable = context.getResources().getDrawable(R.drawable.ic_xiaonei);
                break;
            case StateConstant.JOB_LEAFFLET:
                drawable = context.getResources().getDrawable(R.drawable.ic_fachuandan);
                break;
            case StateConstant.JOB_DESIGN:
                drawable = context.getResources().getDrawable(R.drawable.ic_sheji);
                break;
            case StateConstant.JOB_INTERN_STUDENT:
                drawable = context.getResources().getDrawable(R.drawable.ic_shixi);
                break;
            case StateConstant.JOB_POPULARIZATION:
                drawable = context.getResources().getDrawable(R.drawable.ic_tuiguang);
                break;
            case StateConstant.JOB_CODING:
                drawable = context.getResources().getDrawable(R.drawable.ic_biancheng);
                break;
            case StateConstant.JOB_OTHER:
                drawable = context.getResources().getDrawable(R.drawable.ic_other);
                break;
        }
        return  drawable;
    }

    public String getJobStateString(int jobState){

        String jobStateString = null;
        switch (jobState){
            case StateConstant.JOB_STATE_PUBLISHING:
                jobStateString = "正在审核";
                break;
            case StateConstant.JOB_STATE_FAIL:
                jobStateString = "审核失败";
                break;
            case StateConstant.JOB_STATE_PUBLISHED:
                jobStateString = "已经发布";
                break;
            case StateConstant.JOB_STATE_QUIT:
                jobStateString = "结束发布";
                break;
            case StateConstant.JOB_STATE_PUBLISHING_DELETE:
                jobStateString = "已删除";
                break;
            case StateConstant.JOB_STATE_FAIL_DELETE:
                jobStateString = "已删除";
                break;
            case StateConstant.JOB_STATE_FAIL_QUIT_DELETE:
                jobStateString = "已删除";
                break;

        }
        return jobStateString;
    }




}
